<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<style type="">

#mytable td{
padding-left:5px;
padding-bottom: 2px;
padding-top: 2px;
}
 
#sou{
padding-top:10px;
  height: 505px;
  width: 800px;

}
#mytable{
 width: 700px;
 height: 450px;
 margin-left:50px;
 
}
tr{
 width:700px;
 height: 28px;
}
</style>
             <div id="sou" style="margin:0;">
             <input type="text" style="display:none;" id="pagecount" />
 					 <div style="margin-left:50px">资源名称 &nbsp;&nbsp;&nbsp;<input id="searchKey"  type="text" style="border-radius:4px;"/> &nbsp;&nbsp;&nbsp;<a onclick="searchbykey()" id="search" href="#" style="display:inline-block;text-decoration:none;border-radius:5px;width:58px;height:24px;text-align:center;border:1px solid #000">搜索</a>
				     &nbsp; &nbsp; &nbsp; &nbsp;<input type="button" value="确定" id="but"/></div>
				   <div style="height:20px"></div>
 					<input type="text" style="display:none;" id="pagecount" />
				   <table   border="1"   id="mytable">
					<tr>
					  <td>请选择</td>
				      <td>资源id</td>
				      <td>资源名称</td>
				      <td>资源地址</td>
				   </tr>
				   
				   <c:forEach var="item" items="${videoResource_list}" >
				    <tr>
				      <td>&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="rad"  id="radio"/></td>
				      <td class="id">${item.id}</td>
				      <td class="rd" >${item.name}</td>
				      <td>${item.url}</td>
				   </tr>
				    </c:forEach>
					</table>
				    	 

					<input type="text" style="display:none" id="rscount" value='${totalPageCount }'>
					</div>
<script language="javascript" type="text/javascript"> 
$(function(){
    //用jQuery获取table中td值
    $("table tr").click(function(){
        var ale=$(this).find(".id").text();
        var ales=$(this).find(".rd").text();
        $("#but").click(function(){
        	parent.$("#resourceId").val(ale);
            parent.$("#resourceName").val(ales);
          //先得到当前iframe层的索引
          var index = parent.layer.getFrameIndex(window.name);
          //再执行关闭
          parent.layer.close(index);
        })
    });
    
    
    
    $("#mytable td").click(function() {
        //td的id 
        $(this).attr("id");
        //tr的id  
        $(this).parent().attr("id");
    });
});

</script>